///////////////////////////////////////////////////////////////////////////
//																		 //
//	Author:		Michael Mozdzierz										 //
//	Date:		10/25/2014												 //
//	Purpose:	Define 3D shapes										 //
//																		 //
///////////////////////////////////////////////////////////////////////////


#ifndef _GEOMETRY_H
#define _GEOMETRY_H

#include "Vectors.h"

// represents a 3-dimensional prism
struct Box3D
{
	// the left-most x coordinate of the box
	float left;
	// the right-most x coordinate of the box
	float right;
	// the top-most y coordinate of the box
	float top;
	// the bottom-most y coordinate of the box
	float bottom;
	// the front-most z coordinate of the box
	float front;
	// the back-most z coordinate of the box
	float back;

	Box3D(void);
	Box3D(float left, float right, float top, float bottom, float front, float back);
};

// represents a 3D ball
struct Sphere3D
{
	// the world position of the center of the sphere
	Vector3 center;
	// the distance from the center to the edge of the sphere
	float radius;

	Sphere3D(void);
	Sphere3D(float x, float y, float z, float radius);
	Sphere3D(Vector3 xyz, float radius);
	Sphere3D(Vector4);
};

// represents a 2D rectangle
struct Box2D
{
	// the left-most x-axis value of the rectangle
	float left;
	// the right-most x-axis value of the rectangle
	float right;
	// the top-most y-axis value of the rectangle
	float top;
	// the bottom-most y-axis value of the rectangle
	float bottom;

	Box2D(void);
	Box2D(float left, float right, float top, float bottom);
	Box2D(Vector2 location, float width, float height);

	// get the width of the rectangle
	float getWidth(void) const { return right - left; }
	// get the height of the rectangle
	float getHeight(void) const { return bottom - top; }

	// set the height of the rectangle
	void setWidth(float value) { right = left + value; }
	// set the height of the rectangle
	void setHeight(float value) { bottom = top + value; }

	// get the position of the rectangle
	Vector2 getPosition(void) const { return Vector2(left, top); }
	// set the position of the rectanlge
	void setPosition(Vector2 value);

	bool Contains(Vector2 value);
};

#endif